<%@ page language="java" import="com.alibaba.fastjson.JSONObject" pageEncoding="UTF-8" %>
<%@ page import="weaver.conn.RecordSet" %>
<%@ page import="weaver.general.Util" %>
<%--获取传阅数量--%>
<%
    RecordSet rs = new RecordSet();
    JSONObject jsonData = new JSONObject();
    String requestid = Util.null2String(request.getParameter("requestid"));

    //0：创建 1：审批 2：提交 3：归档
    rs.executeQuery( "select count(requestid) from workflow_requestbase where requestid=? and currentnodetype in (1,2)", requestid );
    rs.next();
    int count = Util.getIntValue( rs.getString( 1 ),-1);
    if (count>0){
        rs.executeQuery( "select distinct userid,usertype,agenttype,agentorbyagentid from workflow_currentoperator\n" +
                " where (isremark in ('0','1','5','7','8','9') or (isremark='4' and viewtype=0))  and requestid = ?", requestid );
        rs.next();
        jsonData.put( "userid", Util.null2String( rs.getString("userid")));
        jsonData.put( "status", true);
    }else {
        jsonData.put( "status", false);
    }



    out.print( jsonData.toJSONString() );

%>
